home *** CD-ROM | disk | FTP | other *** search
- 127
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- CopyXFiles
- --- RECORDSEPARATOR ---
- Platform:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Windows and Macintosh
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Description:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- baCopyXFiles copies multiple files from one folder to another folder, with wildcard
- --- RECORDSEPARATOR ---
- matching.
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Usage:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Result = baCopyXFiles( SourceDir , DestDir , FileSpec , Overwrite )
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Arguments:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- String, String, String, String.
- --- RECORDSEPARATOR ---
- SourceDir is the folder to copy from.
- --- RECORDSEPARATOR ---
- DestDir is the folder to copy to.
- --- RECORDSEPARATOR ---
- FileSpec determines what files are copied.
- --- RECORDSEPARATOR ---
- Overwrite determines how the copy is done. Can be:
- --- RECORDSEPARATOR ---
- "Always"
- --- RECORDSEPARATOR ---
- always copies the file
- --- RECORDSEPARATOR ---
- "IfNewer"
- --- RECORDSEPARATOR ---
- copies the file if SourceFile is newer than DestFile
- --- RECORDSEPARATOR ---
- "IfNotExist"
- --- RECORDSEPARATOR ---
- copies only if DestFile does not already exist
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Returns:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Integer.
- --- RECORDSEPARATOR ---
- Returns 0 if
- --- RECORDSEPARATOR ---
- all the files were copied successfully, otherwise one of these:
- --- RECORDSEPARATOR ---
- 1
- --- RECORDSEPARATOR ---
- Invalid SourceDir name
- --- RECORDSEPARATOR ---
- 2
- --- RECORDSEPARATOR ---
- Invalid DestDir file name
- --- RECORDSEPARATOR ---
- 3
- --- RECORDSEPARATOR ---
- Error reading a Source file
- --- RECORDSEPARATOR ---
- 4
- --- RECORDSEPARATOR ---
- Error writing a Dest file
- --- RECORDSEPARATOR ---
- 5
- --- RECORDSEPARATOR ---
- Couldn't create directory for Dest files
- --- RECORDSEPARATOR ---
- 6
- --- RECORDSEPARATOR ---
- Dest file exists
- --- RECORDSEPARATOR ---
- 7
- --- RECORDSEPARATOR ---
- Dest file is newer that Source file
- --- RECORDSEPARATOR ---
- 8
- --- RECORDSEPARATOR ---
- No files matched the specified wildcard
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Examples:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Director:
- --- RECORDSEPARATOR ---
- set OK = baCopyXFiles( "c:\data" , "d:\backup" , "*.dat " , "IfNewer" )
- --- RECORDSEPARATOR ---
- Authorware:
- --- RECORDSEPARATOR ---
- OK := baCopyXFiles( "c:\\data" , "d:\\backup" , "*.dat" , "IfNewer" )
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Notes:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- By default, this function will not overwrite an existing file if that file is marked as
- --- RECORDSEPARATOR ---
- read-only. However, by adding "+" to the "Always" and "IfNewer" options ( eg
- --- RECORDSEPARATOR ---
- "Always+" or "IfNewer+"), the files will be overwritten if they are read-only.
- --- RECORDSEPARATOR ---
- The return value will not be 0 if any file is not copied. For example, if you specify
- --- RECORDSEPARATOR ---
- baCopyXFiles( "c:\data" , "d:\backup" , "*.*" , "IfNewer" )
- --- RECORDSEPARATOR ---
- and any of the files in c:\data are newer than the ones in d:\backup, the return
- --- RECORDSEPARATOR ---
- result will be 7 (Dest file is newer than Source). A result of 0 will be returned only if
- --- RECORDSEPARATOR ---
- none of the files in c:\data is newer than d:\backup.
- --- RECORDSEPARATOR ---
- On
- --- RECORDSEPARATOR ---
- Windows
- --- RECORDSEPARATOR ---
- , the FileSpec argument follows normal DOS wildcard rules. A *
- --- RECORDSEPARATOR ---
- means match any character in the file name. So *.* copies all files; *.bmp copies
- --- RECORDSEPARATOR ---
- all files with a .bmp extension; T*.* copies all files starting with the letter T.
- --- RECORDSEPARATOR ---
- On
- --- RECORDSEPARATOR ---
- Macintosh
- --- RECORDSEPARATOR ---
- , the Filespec is the four character type code eg "TEXT". Only one
- --- RECORDSEPARATOR ---
- type can be specified. Use an empty string or "*.*" to match all files.
- --- RECORDSEPARATOR ---
- A return value of 6 (Dest file exists) can only be returned when Overwrite is
- --- RECORDSEPARATOR ---
- "IfNotExist".
- --- RECORDSEPARATOR ---
- A return value of 7 (Dest file is newer than Source file) can only be returned when
- --- RECORDSEPARATOR ---
- Overwrite is "IfNewer". The other return values can be returned for all Overwrite
- --- RECORDSEPARATOR ---
- options.
- --- RECORDSEPARATOR ---
- The "IfNewer" option operates as follows: if both files have internal version
- --- RECORDSEPARATOR ---
- numbers, then these numbers are used for comparison, otherwise the dates of the
- --- RECORDSEPARATOR ---
- two files are used for comparison.
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- See also:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- baCopyFile